// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import moment from 'vue-moment'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import { VueAxios } from './utils/request'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock'

import bootstrap from './core/bootstrap'
import './core/lazy_use'
import './permission' // permission control
import './utils/filter' // global filter
import './components/global.less'
import { Dialog } from '@/components'

Vue.config.productionTip = false

/**
 * 注册全局方法
 */
// 判断是否为空
Vue.prototype.$isNull = obj => {
  if (obj == null || obj === '' || obj === undefined) {
    return true
  }
  return false
}
// 删除字符串两边的空格
Vue.prototype.$trim = obj => {
  if (obj == null || obj === '' || obj === undefined) {
    return null
  }
  obj = obj.trim()
  if (obj == null || obj === '' || obj === undefined) {
    return null
  }
  return obj
}
// mount axios Vue.$http and this.$http
Vue.use(VueAxios)
Vue.use(Dialog)
Vue.use(moment)
new Vue({
  router,
  store,
  created: bootstrap,
  render: h => h(App)
}).$mount('#app')
